import 'package:pacsun/theme/app_colors.dart';
import 'package:pacsun/view/create/createBecomeCreator.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'dart:math';

class BeComebtn extends StatelessWidget {
  const BeComebtn({super.key});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        Navigator.push(
            context,
            MaterialPageRoute(
                builder: (context) => const BecomeCreator(sourceIndex: 2)));
      },
      child: Container(
        width: 335.w,
        height: 55.h,
        decoration: BoxDecoration(
          color: AppColors.red,
          borderRadius: BorderRadius.circular(27.5).r,
        ),
        child: Stack(
          fit: StackFit.expand,
          clipBehavior: Clip.none,
          children: [
            Text(
              'BECOME A CREATOR',
              style: customTextStyle(
                fontSize: 20,
                fontWeight: 600,
                height: 55 / 20,
              ),
              textAlign: TextAlign.center,
            ),
            Positioned(
              right: 0.w,
              top: -22.h,
              child: Transform.rotate(
                angle: -(8.44 * pi / 180), // 旋转8.44度
                child: Container(
                  width: 86.w,
                  height: 29.h,
                  decoration: BoxDecoration(
                    color: Color(0XFFf4ba40),
                    borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(7),
                      topRight: Radius.circular(7),
                      bottomRight: Radius.circular(7),
                    ).r,
                    boxShadow: [
                      BoxShadow(
                        color: Color(0x40000000), // #00000040
                        offset: Offset(4, 4), // x:4, y:4
                        blurRadius: 0, // 模糊半径
                        spreadRadius: 0, // 扩散半径
                      ),
                    ],
                  ),
                  alignment: Alignment.center,
                  child: Text(
                    'EARN NOW!',
                    style: customTextStyle(
                      fontSize: 12,
                      fontWeight: 700,
                      color: FamilyTextColor.black,
                    ),
                  ),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
